
// // load the library
 var SMB2 = require('@marsaud/smb2');


// var buffer = Buffer.allocUnsafe(3);

// for(var i = 0; i < 3; i ++){
//     // write NetBios cmd
//     buffer.writeUInt8(0x00, i);
// }
// console.log(buffer)

// buffer.writeUInt16BE(0xffff & 1, 1);



// // create an SMB2 instance
var smb2Client = new SMB2({
 // share: '\\\\192.168.2.140\\share',
  share: '\\\\127.0.0.1\\share',
  username: 'alin',
  domain: "cc",
  password: 'alin',
});

smb2Client.readdir('', function(err, files) {
  if (err) throw err;
  console.log(files);
});

// import smb2 from "@stifani/smb2";

// const client = new smb2.Client("127.0.0.1", {connectTimeout:100000, requestTimeout:1000000});
// const session = await client.authenticate({
//   domain:"127.0.0.1",
//   username:"alin",
//   password:"alin"
// });
// const tree = await session.connectTree("share");

// const entries = await tree.readDirectory("/");
// console.log(entries);